\tracingonline=2
\tracingcommands=2
\tracingmacros=2
\tracingrestores=2

\catcode`{=1
\catcode`}=2
\catcode`$=3
\catcode`#=6

\afterassignment\relax
\count0=10\count1=20

\afterassignment\showthe
\count2=30\count0

\afterassignment\showthe
\setbox0=\hbox{\count0}

{
\afterassignment\showthe
}
\count3=40\count0

\def\x{\showthe\count1}
\afterassignment\x\count0=10\count2=40

\end
